﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

/// <summary>
/// 加载中面板
/// </summary>
public class LoadingPanel : ShowHideBehaviour {

    private Slider Slider;
    private Dictionary<string, AsyncOperation> AsyncOperationDictionary = new Dictionary<string, AsyncOperation>();

    // Use this for initialization
    void Start () {
        base.InitShowHide();
        this.Slider = GetComponentInChildren<Slider>();
    }
	
	// Update is called once per frame
	void Update () {
        base.HandleShowHide();
        UIHelper.UpdateSceneSlider(this.AsyncOperationDictionary, this.Slider);
    }

    public void LoadScene(string sceneName) {
        StartCoroutine(UIHelper.LoadSceneAsync(sceneName, this.AsyncOperationDictionary));
    }
}
